package ch11_多线程与并发;

class MyThread extends Thread {
	public void run() {
		System.out.println("线程1运行了。");
	}
}

class MyRunnable implements Runnable{
	public void run() {
		System.out.println("线程2运行了。");
	}
}
public class ThreadDemo {
	public static void main(String[] args) {
		Thread t1 = new MyThread();

		Runnable target = new MyRunnable();
		Thread t2 = new Thread(target);

		Thread t3 = new Thread(() -> System.out.println("线程3运行了。"));

		t1.start();
		t2.start();
		t3.start();
	}
}
